package file;

import java.io.File;

public class FileDemo {
    public static void main(String[] args) {
        /**
         * 绝对路径：C:/Users/tedu/IdeaProjects......
         * 相对路径：./表示当前目录   ./demo.txt，可以忽略不写demo.txt
         */

        File file =new File("./demo.txt");
        System.out.println(file.getName());
        System.out.println(file.length());

        System.out.println(file.canRead());//是否可读
        System.out.println(file.canWrite());//是否可写
        System.out.println(file.isHidden());//是否隐藏
    }
}
